Descriptions
There is no desription for trigger INVENTARIO_BI
 
Definition
CREATE TRIGGER INVENTARIO_BI FOR INVENTARIO ACTIVE
BEFORE INSERT POSITION 0
AS
declare variable hoy date;
declare variable cola integer;
BEGIN
IF (NEW.ID_ARTICULO IS NULL) THEN
BEGIN
hoy = 'TODAY';
cola= GEN_ID(GEN_INVENTARIO_ID,1);
NEW.ID_ARTICULO = EXTRACT(YEAR FROM hoy)* 10000 + cola;
IF ( cola >9999) THEN
EXECUTE STATEMENT 'SET GENERATOR GEN_INVENTARIO_ID TO 0';
END
if (new.existencia is null) then
new.existencia = 0;
if (new.existencia_inicial is null) then
new.existencia_inicial =0;
if (new.costo is null )then
new.costo =0;
if (new.salidas is null) then
new.salidas = 0;
if (new.entradas is null) then
new.entradas = 0;
new.ultima_entrada ='TODAY';
new.ultima_salida = 'TODAY';
END
| This file was generated with EMS InterBase/FireBird Manager (www.ibmanager.com) at 09/06/2005 05:52 p.m. |
|